![]() |
SetRect |
||||
Header: | Quickdraw.h | Carbon status: | Supported | |
Assigns coordinates to a rectangle.
void SetRect ( Rect *r, SInt16 left, SInt16 top, SInt16 right, SInt16 bottom );
A pointer to the rectangle to set.
The horizontal coordinate of the new upper-left corner of the rectangle.
The vertical coordinate of the new upper-left corner of the rectangle.
The horizontal coordinate of the new lower-right corner of the rectangle.
The vertical coordinate of the new lower-right corner of the rectangle.
The SetRect function assigns the coordinates you specify in the left, top, right, and bottom parameters to the rectangle that you specify in the r parameter. This function is provided to help you shorten your program text. If you want a more readable text, at the expense of source text length, you can instead assign integers (or points) directly into the fields of a Rect structure.
You can use a rectangle to specify locations and sizes for various graphics operations.
If the points or rectangles supplied to this function are defined in a graphics port other than your current graphics port, you must convert them to the local coordinate system of your current graphics port. You can accomplish this by using the SetPort function to change to the graphics port containing the points or rectangles, using the LocalGlobal function to convert their locations to global coordinates, using SetPort to return to your starting graphics port, and then using the GlobalToLocal function to convert the locations of points or rectangles to the local coordinates of your current graphics port.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)